<template>
  <div>
    <button @click="handleClick">click</button>
    <input type="text" v-model="a" />
  </div>
</template>
<script setup>
//这里的a,b变量可以随意命名
const [a, b] = defineModel({
  set(val) {
    if (b.capitalize) {
      return val.charAt(0).toUpperCase() + val.slice(1);
    }
    return val;
  },
  get(val) {
    console.log(val, "get");
    return b.capitalize ? val + 1 : val;
  },
});
const handleClick = () => {
  console.log("child");
};
</script>
<style>
</style>
